import React, { Component } from 'react'
import ReactSwipe from 'react-swipe';
import { Link } from 'react-router-dom';
import Styles from './index.less'
export default class Carousel extends Component {
  render() {
      const { carouselList } = this.props
      return (
          <ReactSwipe className={Styles.carousel} swipeOptions={{continuous: true, auto: 3000}}>
              {carouselList.map((item) => (
                <div key={item.img}>
                  <img src={item.img} className={Styles.img}/>
                  <Link to={item.link} className={Styles.mask}/>
                </div>
                ))} 
          </ReactSwipe>
      );
  }
}
